Page({
  data:{
      isPlaying:true,
      src:'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      name:'此时此刻',
      name:'许巍',
      poster:'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000',
      music:{
          src:'http://fs.web.kugou.com/e2a3516dd4cdf15ee7d6a4a7d801d8bc/58beb3e7/G049/M07/18/1B/0YYBAFYkgkyAXPmxADOIk6kaIoc779.mp3',
          poster:'http://imge.kugou.com/stdmusic/20150718/20150718114727720415.jpg',
          name:'voice'
      }
  },
  onLoad:function(options){
    
  },
  onReady:function(){
    
  },
  onPlayTap:function(event){
     var isPlaying = this.data.isPlaying;
     if(isPlaying){
      wx.playBackgroundAudio({
        dataUrl: this.data.music.src,
        title:this.data.music.name,
        coverImg:this.data.music.poster
      })
      this.setData({isPlaying:false});
     }else{
      wx.pauseBackgroundAudio();
      this.setData({isPlaying:true});
     }
  }
})